<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<%
 String contextPath = request.getContextPath();
%>
<html>
<head><title>
	
        我的订单确认|玩乐团，让我们一起玩转地球！|团购|石家庄团购|石家庄团购网
    
</title>
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />
<link rel="stylesheet" href="<%=contextPath%>/css/css.css" type="text/css"/>
<script type="text/javascript" src="<%=contextPath%>/js/jquery-1.3.2.js"></script>
<script type="text/javascript" src="<%=contextPath%>/js/javascript.js"></script>
    <script>
        function pay()
        {
            //先判断账户余额是否够支付
            var totalFee = $("#lblFee").html()*1;
            var userFee = $("#lblUserMoney").html()*1;
            
            if(totalFee<=userFee)
            {
                alert("您的账户余额足够支付本次团购费用，点击【确定】从账户上扣款！");
                PayByMe();
            }
            else
            {
                var unpay = totalFee-userFee;
                alert("您的账户余额已不足支付本次团购费用，请您选择支付方式再次支付【￥"+unpay.toFixed(2)+"元】！");
                var payid = "";
                $("input[name=radPay]").each(function()
                {
                    if($(this).attr("checked"))
                        payid = $(this).attr("value");
                });
                if(payid=="")
                {
                    alert("请选择支付方式后再继续！");
                    return;
                    }
                
                //更新订单的支付方式值
                JqueryAjax('opt.aspx?type=SavePay&&orderid=14122&pid='+payid, false, "html", function(data){
                    if(data=="1")
                        document.location.href='order3.aspx?orderid=14122&pid='+payid;
                
                });
                }
            
            
            
        }
        
        function PayByMe()
        {
            JqueryAjax('opt.aspx?type=PayByMe&orderid=14122', false, "html", function(data){
            
                if(data=="1")
                    {
                        //alert("订单支付成功，感谢您的支持！继续享受团购的乐趣吧！");
                        document.location.href='orderover.aspx?orderid=14122';
                    }
                    else
                        showMsg("divMsg",data);
            
            });
        }
    </script>
</head>
<body>
    <form name="form1" method="post" action="order2.aspx?id=14122" id="form1">
<div>
<input type="hidden" name="__VIEWSTATE" id="__VIEWSTATE" value="/wEPDwULLTE5NjczOTMwODUPZBYCAgMPZBYIAgMPDxYCHgRUZXh0BRIyMDExMDcyNjE2NTYyMDUwNzJkZAIFDw8WAh8ABQMzOTFkZAIHDw8WAh8ABQQwLjAwZGQCCQ8QZA8WAmYCARYCEAUaPGRpdiBjbGFzcz0nYWxpcGF5Jz48L2Rpdj4FATFnEAVrPGRpdiBjbGFzcz0nY2hpbmFiYW5rJz7mlK/mjIHmi5vllYbjgIHlt6XooYzjgIHlu7rooYzjgIHkuK3ooYzjgIHkuqTooYznrYnkuLvmtYHpk7booYznmoTnvZHpk7bmlK/ku5g8L2Rpdj4FATJnZGRktpy5AOH/js05Rw6CDF3C1InrhMI=" />
</div>

<div>

	<input type="hidden" name="__EVENTVALIDATION" id="__EVENTVALIDATION" value="/wEWBAL0h72LDQL24sq0DAL34sq0DAL5jeBaYUgtfQx4UjkZ77dby8hOWAjIUtg=" />
</div>
<div style="position:absolute; left:240px; top:500px; width:500px; z-index:1000;"   id="divMsg"></div>
    
<jsp:include page="/template/top.jsp"></jsp:include>
    
     <div class="yq_link">
                
                <div class="yqt2">
                    <img src="images/step2.png" />
                </div>
                <div class="yqc2"  align=left style="padding-left:30px;">
                   <!--主体内容-->
                   <div class="head">
                        <h2>
                            <span style="font-size: 21pt; border-bottom:dotted 1px #c6c6c6; width:98%;">您的订单号:<span id="lblOrder" class="CartTotalFee">201107261656205072</span> 订单总额：<span class="money"  class="CartTotalFee" style="font-family: Helvetica">¥</span><span id="lblFee" class="CartTotalFee">391</span>元</span>
                           </h2>
                    </div>
                    
                    <div class="head">
                        <h2>
                            <span style="font-size: 21pt; border-bottom:dotted 1px #c6c6c6; width:98%;">您的账户余额:<span id="lblUserMoney" class="CartTotalFee">0.00</span> 
                            </span>
                            <input type=button onclick="PayByMe();" id="btnMyPay" class="Cartbutton" value="从我的账户中扣款" />
                        </h2>
                    </div>
                    <div style="padding-left:0px; margin-top:20px;">
                       <h2><span style="font-size: 15pt; border-bottom:dotted 1px #c6c6c6; width:900px;">请选择支付方式：</span> 
                       <input type=button onclick="pay();" id="btnOK" class="Cartbutton" value="立即支付订单" />
                       </h2>
                       <table id="radPay" border="0">
							<tr>
								<td><input id="radPay_0" type="radio" name="radPay" value="1" /><label for="radPay_0"><div class='alipay'></div></label></td>
							</tr><tr>
								<td><input id="radPay_1" type="radio" name="radPay" value="2" /><label for="radPay_1"><div class='chinabank'>支持招商、工行、建行、中行、交行等主流银行的网银支付</div></label></td>
							</tr>
						</table>
                    </div>
                    <div align=center style="margin-bottom:10px;">
                    </div>
                      
                 </div>
                 <div class="yqb2">
                 </div>
            </div>
<jsp:include page="/template/frendlink.jsp"></jsp:include>
<jsp:include page="/template/bottom.jsp"></jsp:include>
</form>
</body>
</html>
